package com.vecspace.sso.entity;

/**
 * Department entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class SSODepartment implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	
	private static final long serialVersionUID = 1004L;
	private Long id;
	private Long tenantId;
	private Long parentId;
	private Integer ordnum;
	private String name;
	private String address;
	private String leader;
	private String tel;
	private String districtId;
	private String customId;

	// Constructors

	/** default constructor */
	public SSODepartment() {
	}

	/** minimal constructor */
	public SSODepartment(Long id) {
		this.id = id;
	}

	/** full constructor */
	public SSODepartment(Long id, Long parentId, Integer ordnum,String name, String address,
			String leader, String tel) {
		this.id = id;
		this.parentId = parentId;
		this.ordnum = ordnum;
		this.name = name;
		this.address = address;
		this.leader = leader;
		this.tel = tel;
	}

	// Property accessors

	/**租户ID*/
	public Long getTenantId(){
		return tenantId;
	}
	/**租户ID*/
	public void setTenantId(Long value){
		this.tenantId = value;
	}
	
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getParentId() {
		if(parentId == null) parentId = -1L;
		return this.parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getLeader() {
		return this.leader;
	}

	public void setLeader(String leader) {
		this.leader = leader;
	}

	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public Integer getOrdnum() {
		return ordnum;
	}

	public void setOrdnum(Integer ordnum) {
		this.ordnum = ordnum;
	}

	public String getDistrictId() {
		return districtId;
	}

	public void setDistrictId(String districtId) {
		this.districtId = districtId;
	}

	public String getCustomId() {
		if("".equals(customId))return null;
		return customId;
	}

	public void setCustomId(String customId) {
		this.customId = customId;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj == null)return false;
		if(id == null)return false;
		SSODepartment oth = (SSODepartment)obj;
		return id.equals(oth.id);
	}
}